package com.bgIntlgn.client.entity.warehourse;

import java.util.Date;

import yuhuibear.poat.annotations.action.AutoGenerateValue;
import yuhuibear.poat.annotations.relation.Field;
import yuhuibear.poat.annotations.relation.Table;
import yuhuibear.poat.object.bean.Bean;

/**
 * 出入库单
 * 
 * @author yuhui
 * 
 */
@Table(name = "storage_bills", constrain = "")
public class StorageBill implements Bean {

	@AutoGenerateValue(skipOnNull = true, sqlToGet = "select currval('storage_bills_id_seq')")
	@Field(name = "id", type = "bigserial", constrain = "primary key ")
	private Long id;

	/**
	 * 流水号
	 */
	@Field(name = "source_serial_nu", type = "varchar(80)", constrain = "")
	private String sourceSerialNu;

	/**
	 * 来源流水号
	 */
	@Field(name = "serial_nu", type = "varchar(80)", constrain = "unique")
	private String serialNu;

	/**
	 * 入库类型， 生产入库， 备库, 采购入库， 维修退库等等。。。[DictionaryType : 出入库类型]
	 */
	@Field(name = "type", type = "int8", constrain = "not null references dictionarys(id)  on update cascade on delete cascade")
	private Long type;

	/**
	 * 入库时间戳
	 */
	@Field(name = "create_date", type = "timestamp", constrain = "")
	private Date date;

	/**
	 * 对应的仓库
	 */
	@Field(name = "depository_id", type = "int8", constrain = "not null references depositories(id)  on update cascade on delete cascade")
	private Long depositoryId;

	/**
	 * 经手人。
	 */
	@Field(name = "reciever", type = "int8", constrain = "not null references employees(id)  on update cascade on delete cascade")
	private Long reciever;

	/**
	 * 客户ID ， 可以是供货者， 或者是收货者
	 */
	@Field(name = "customer_id", type = "int8", constrain = "references customs(id)  on update cascade on delete cascade")
	private Long customerID;

	@Field(name = "contactor_id", type = "int8", constrain = "references contactors(id)  on update cascade on delete cascade")
	private Long contactorId;

	/**
	 * 厂内入库的入库来源负责人。
	 */
	@Field(name = "sender", type = "int8", constrain = "references employees(id)  on update cascade on delete cascade")
	private Long sender;

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getSerialNu() {
		return this.serialNu;
	}

	public void setSerialNu(String serialNu) {
		this.serialNu = serialNu;
	}

	public Long getType() {
		return this.type;
	}

	public void setType(Long type) {
		this.type = type;
	}

	public Long getDepositoryId() {
		return this.depositoryId;
	}

	public void setDepositoryId(Long depositoryId) {
		this.depositoryId = depositoryId;
	}

	public Long getReciever() {
		return this.reciever;
	}

	public void setReciever(Long reciever) {
		this.reciever = reciever;
	}

	public Long getCustomerID() {
		return this.customerID;
	}

	public void setCustomerID(Long customerID) {
		this.customerID = customerID;
	}

	public Long getContactorId() {
		return this.contactorId;
	}

	public void setContactorId(Long contactorId) {
		this.contactorId = contactorId;
	}

	public Long getSender() {
		return this.sender;
	}

	public void setSender(Long sender) {
		this.sender = sender;
	}

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getSourceSerialNu() {
		return sourceSerialNu;
	}

	public void setSourceSerialNu(String sourceSerialNu) {
		this.sourceSerialNu = sourceSerialNu;
	}

}
